package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.PProduct;
import com.ruoyi.system.mapper.PProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PKeyRecordMapper;
import com.ruoyi.system.domain.PKeyRecord;
import com.ruoyi.system.service.IPKeyRecordService;

/**
 * 钥匙取用记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-09
 */
@Service
public class PKeyRecordServiceImpl extends ServiceImpl<PKeyRecordMapper, PKeyRecord> implements IPKeyRecordService
{


    /**
     * 查询钥匙取用记录
     * 
     * @param id 钥匙取用记录主键
     * @return 钥匙取用记录
     */
    @Override
    public PKeyRecord selectPKeyRecordById(Long id)
    {
        return baseMapper.selectPKeyRecordById(id);
    }

    /**
     * 查询钥匙取用记录列表
     * 
     * @param pKeyRecord 钥匙取用记录
     * @return 钥匙取用记录
     */
    @Override
    public List<PKeyRecord> selectPKeyRecordList(PKeyRecord pKeyRecord)
    {
        return baseMapper.selectPKeyRecordList(pKeyRecord);
    }

    /**
     * 新增钥匙取用记录
     * 
     * @param pKeyRecord 钥匙取用记录
     * @return 结果
     */
    @Override
    public int insertPKeyRecord(PKeyRecord pKeyRecord)
    {
        pKeyRecord.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertPKeyRecord(pKeyRecord);
    }

    /**
     * 修改钥匙取用记录
     * 
     * @param pKeyRecord 钥匙取用记录
     * @return 结果
     */
    @Override
    public int updatePKeyRecord(PKeyRecord pKeyRecord)
    {
        pKeyRecord.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updatePKeyRecord(pKeyRecord);
    }

    /**
     * 批量删除钥匙取用记录
     * 
     * @param ids 需要删除的钥匙取用记录主键
     * @return 结果
     */
    @Override
    public int deletePKeyRecordByIds(Long[] ids)
    {
        return baseMapper.deletePKeyRecordByIds(ids);
    }

    /**
     * 删除钥匙取用记录信息
     * 
     * @param id 钥匙取用记录主键
     * @return 结果
     */
    @Override
    public int deletePKeyRecordById(Long id)
    {
        return baseMapper.deletePKeyRecordById(id);
    }
}
